<?php
/**
 * Copyright (c) 2012, xxworkshop Inc.
 * All rights reserved.
 *
 * Created by BrocheXu on 2014.11.6
 */
require_once 'accesstokenmanager.class.php';

class UserManager {
	const UserUrl = 'https://api.weixin.qq.com/cgi-bin/user/';
	private $accessTokenManager;
	
	public function __construct($appid, $appsecret) {
		$this->accessTokenManager = new AccessTokenManager($appid, $appsecret);
	}
	public function getUserInfo($openid) {
		$url = self::UserUrl.'info?access_token='.$this->accessTokenManager->getToken().'&lang=zh_CN&openid='.$openid;
		return json_decode(file_get_contents($url), true);
	}
}

?>